#define  _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

class Stack
{
public:
	Stack(size_t capacity = 4)
	{
		_arr = (int*)malloc(sizeof(int) * capacity);
		if (_arr == nullptr)
		{
			perror("malloc fail");
			exit(1);
		}
		_top = 0;
		_capacity = capacity;
	}

	~Stack()
	{
		free(_arr);
		_arr = nullptr;
		_top = 0;
		_capacity = 0;
	}



private:
	int* _arr;
	int _top;
	int _capacity;
};

//int main()
//{
//	Stack st1;
//	Stack st2(10);
//
//	return 0;
//}